const { DataTypes } = require('sequelize')
const seq = require('../db/seq')

const Goods = seq.define('goods', {
    goodsName: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '商品名称'
    },
    goodsPrice: {
        type: DataTypes.DECIMAL(10, 2),
        allowNull: false,
        comment: '商品价格'
    },
    goodsNum: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: '商品库存'
    },
    goodsImg: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '商品图片'
    },
    goodsType: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '商品类型'
    },
    onShopping: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '是否上架'
    },
})
// Goods.sync({force: true})
module.exports = Goods